home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer Helper 1: Phil & Dave's Excellent CD
/
Excellent CD HFS.raw
/
Moof
/
Goodies
/
HyperCard Goodies
/
HyperCard Dev. ToolKit
/
Serial & MacinTalk XCMDs
/
Flash.p
< prev
next >
Wrap
Text File
|
1987-06-15
|
1KB
|
68 lines
{$R-}
(*
flash -- a sample HyperCard external command
To compile and link this file using Macintosh Programmer's Workshop,
pascal -w Flash.p
pascal -w XCmdUtil.p
asm -w XCmdUtil.a
link -m ENTRYPOINT -o HyperCommands -rt XCMD=0 -sn Main=Flash Flash.p.o ∂
XCmdUtil.p.o XCmdUtil.a.o "{MPW}"Libraries:interface.o
*)
{$S Flash } { Segment name must be the same as the command name. }
UNIT DummyUnit;
INTERFACE
USES MemTypes, QuickDraw, HyperXCmd, XCmdUtil;
PROCEDURE EntryPoint(paramPtr: XCmdPtr);
IMPLEMENTATION
PROCEDURE Flash(paramPtr: XCmdPtr); FORWARD;
PROCEDURE EntryPoint(paramPtr: XCmdPtr);
BEGIN
Flash(paramPtr);
END;
PROCEDURE Flash(paramPtr: XCmdPtr);
VAR flashCount: LongInt;
i: INTEGER;
port: GrafPtr;
str: Str255;
PROCEDURE Fail(errMsg: Str255); { set theResult and quit }
BEGIN
paramPtr^.returnValue := PasToZero(errMsg);
EXIT(Flash);
END;
BEGIN
IF paramPtr^.paramCount <> 1 THEN Fail('parameter count is not 1');
ZeroToPas(paramPtr^.params[1]^,str); { first param is flash count }
flashCount := StrToNum(str);
IF ODD(flashCount) THEN Fail('can''t flash an odd number of times');
GetPort(port);
FOR i := 1 TO flashCount DO
BEGIN
InvertRect(port^.portRect);
InvertRect(port^.portRect);
END;
END;
END.